using System;
using System.Collections.Generic;
using System.Text;
using ApprovalTests;
using ApprovalTests.Reporters;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace SmallBasicFun.Tests
{
	[TestClass]
	
	public class ColorGenerator
	{
		[TestMethod]
		public void TestColorWheel()
		{
			var colors = GetColors();
			StringBuilder b = new StringBuilder();
			foreach (var color in colors)
			{
				b.Append(DoColor(color));
			}
			Approvals.Verify(b.ToString());
		}

		private string DoColor(string color)
		{
			String code = @"/// <summary>
		/// This is the same as ""{0}""
		/// </summary>
		public static Primitive {0}
		{
			get { return new Primitive(""{0}""); }
		}
		";
			 code = @"
/// <summary>
/// This is the same as ""{0}""
/// </summary>
public static Primitive {0}
{{
	get {{ return new Primitive(""{0}""); }}
}}
";
			return string.Format(code, color);
		}

		private string[] GetColors()
		{
			var all =  new[]
			       	{
			       		"IndianRed", "Blue", "Purple", "LightCoral", "Salmon", "DarkSalmon", "LightSalmon", "Crimson", "Red",
			       		"FireBrick", "DarkRed", "PinkColors", "Pink", "LightPink", "HotPink", "DeepPink", "MediumVioletRed",
			       		"PaleVioletRed", "IndianRed", "LightCoral", "Salmon", "DarkSalmon", "LightSalmon", "Crimson", "Red",
			       		"FireBrick", "DarkRed", "PinkColors", "Pink", "LightPink", "HotPink", "DeepPink", "MediumVioletRed",
			       		"PaleVioletRed", "OrangeColors", "LightSalmon", "Coral", "Tomato", "OrangeRed", "DarkOrange", "Orange",
			       		"YellowColors", "Gold", "Yellow", "LightYellow", "LemonChiffon", "LightGoldenrodYellow", "PapayaWhip",
			       		"Moccasin", "PeachPuff", "PaleGoldenrod", "Khaki", "DarkKhaki", "Lavender", "Thistle", "Plum", "Violet",
			       		"Orchid", "Fuchsia", "Magenta", "MediumOrchid", "MediumPurple", "BlueViolet", "DarkViolet", "DarkOrchid",
			       		"DarkMagenta", "Purple", "Indigo", "SlateBlue", "DarkSlateBlue", "MediumSlateBlue", "GreenColors",
			       		"GreenYellow", "Chartreuse", "LawnGreen", "Lime", "LimeGreen", "PaleGreen", "LightGreen",
			       		"MediumSpringGreen", "SpringGreen", "MediumSeaGreen", "SeaGreen", "ForestGreen", "Green", "DarkGreen",
			       		"YellowGreen", "OliveDrab", "Olive", "DarkOliveGreen", "MediumAquamarine", "DarkSeaGreen", "LightSeaGreen",
			       		"DarkCyan", "Teal", "BlueColors", "Aqua", "Cyan", "LightCyan", "PaleTurquoise", "Aquamarine", "Turquoise",
			       		"MediumTurquoise", "DarkTurquoise", "CadetBlue", "SteelBlue", "LightSteelBlue", "PowderBlue", "LightBlue",
			       		"SkyBlue", "LightSkyBlue", "DeepSkyBlue", "DodgerBlue", "CornflowerBlue", "MediumSlateBlue", "RoyalBlue",
			       		"MediumBlue", "DarkBlue", "Navy", "MidnightBlue", "BrownColors", "Cornsilk", "BlanchedAlmond", "Bisque",
			       		"NavajoWhite", "Wheat", "BurlyWood", "Tan", "RosyBrown", "SandyBrown", "Goldenrod", "DarkGoldenrod", "Peru",
			       		"Chocolate", "SaddleBrown", "Sienna", "Brown", "Maroon", "WhiteColors", "White", "Snow", "Honeydew",
			       		"MintCream", "Azure", "AliceBlue", "GhostWhite", "WhiteSmoke", "Seashell", "Beige", "OldLace", "FloralWhite"
			       		, "Ivory", "AntiqueWhite", "Linen", "LavenderBlush", "MistyRose", "GrayColors", "Gainsboro", "LightGray",
			       		"Silver", "DarkGray", "Gray", "DimGray", "LightSlateGray", "SlateGray", "DarkSlateGray", "Black"
			       	};
			var pieces = new List<string>();
			foreach (var s in all)
			{
				if (!pieces.Contains(s))
				{
					pieces.Add(s);
				}
			}
			return pieces.ToArray();
		}
	}
}